package edu.suda.scratcher.ippgserver.servlet;

import java.io.*;
import javax.servlet.http.HttpServlet;
import org.apache.ibatis.session.*;
import org.apache.ibatis.io.*;

public abstract class Action extends HttpServlet {
    private static final long serialVersionUID = 1L;
    static SqlSessionFactory sqlSessionFactory;
    
    static {
        String resource = "mybatis-config.xml";
        try {
            InputStream inputStream = Resources.getResourceAsStream(resource);
            sqlSessionFactory = new SqlSessionFactoryBuilder().build(inputStream);
            System.err.println("SQL session factory initialized.");
        } catch (IOException ex) {
            ex.printStackTrace();
        }
    }

}
